
//解析url
function getQueryStringArgs(){
  var qs = (location.search.length>0?location.search.substring(1):"");
  var args = {};
  var items = qs.length?qs.split("&"):[];
  var item = null;
  var name = null;
  var value = null;
  len = items.length;
  for (var i = 0; i < len; i++) {
    item = items[i].split("=");
    name = decodeURIComponent(item[0]);
    value = decodeURIComponent(item[1]);
    if (name.length) {
      args[name] = value;
    }
  }
  return args;
}
var args = getQueryStringArgs();
$(document).ready(function() {
	if(typeof args["username"]!="undefined" &&  sessionStorage.username!="undefined"){
		$(".userinfo").css({"display":"block"});
	}
	var nav_list = $(".menu_li");
	var iframe = $("#iframe");
	for(var i=0;i<nav_list.length;i++)
	{
		$(nav_list[i]).click(function(){
			for(var j=0;j<nav_list.length;j++){
				$(nav_list[j]).removeClass('current_page_item');
			}
			var index = $(this).index();
			$(this).addClass('current_page_item');						
		});
	}
	$(".home").click(function(event) {
		sessionStorage.id = " ";
		sessionStorage.author = " ";
		sessionStorage.main = " ";
		sessionStorage.tag = " ";
		sessionStorage.time = " ";
		sessionStorage.title = " ";
	});
});
